{include 'admin/layout/header_list'}
<link rel="stylesheet" href="__ADMIN_STATIC__/css/addContent.css?random={extendSetting('random')}">
<div class="addcontent">
    <form class="ajaxForm" method="post" >
        <input type="hidden" name="_method" value="put" >
        <input type="hidden" name="id" value="{if isset($rowData['id'])}{$rowData['id']}{/if}" >
        <input type="hidden" name="moduleId" value="{if isset($request['moduleId'])}{$request['moduleId']}{/if}" >
        <table class="table">
            <tr>
                <td class="tl">
                    <span><strong></strong>分类</span>
                </td>
                <td>
                    <select name="categoryId" class="long" >
                        {LTcms:categoryHtml  dataType="module" dataId="<request.moduleId>" selectId="<rowData.categoryId>" /}
                    </select>
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong>* </strong>文章标题</span>
                </td>
                <td>
                    <input class="long" name="title" type="text" value="{if isset($rowData['title'])}{$rowData['title']}{/if}" >
                </td>
            </tr>
            <tr >
                <td class="tl">
                    <span><strong></strong>级别</span>
                </td>
                <td>
                    <select name="level" class="long" >
                        <option value="0">级别</option>
                        {if $levelList}
                        {foreach  $levelList  $key $val}
                        <option value="{$key}"  {if (isset($rowData['levelData']) && $rowData['levelData'] && in_array($key,$rowData['levelData'])) } selected {/if} >{$val}</option>
                        {/foreach}
                        {/if}
                    </select>
                </td>
            </tr>
            <tr class="webUploadBox">
                <td class="tl">
                    <span><strong></strong>标题图片</span>
                </td>
                <td>
                    <input class="long rendercls" name="thumb" type="text" id="image" value="{if isset($rowData['thumb'])}{$rowData['thumb']}{/if}" >
                    <div class="webUploadFilePicker upload">[上传]</div>
                    <span class="upload" id="clear">[删除]</span>
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>文章简介</span>
                </td>
                <td>
                    <textarea name="description" class="long" rows="5">{if isset($rowData['description'])}{$rowData['description']}{/if}</textarea>
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>文章作者</span>
                </td>
                <td>
                    <input class="short" name="author" type="text" value="{if isset($rowData['author'])}{$rowData['author']}{/if}" >
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong> 浏览次数</span>
                </td>
                <td>
                    <input class="short" name="hits" type="text" value="{if isset($rowData['hits'])}{$rowData['hits']}{/if}" >
                </td>
            </tr>
            {fields_html($request['moduleId'],$rowData)}

            {if  $tags}<!--如果存在该值,说明标签插件已启用正常hook请求-->
            <tr>
                <td class="tl">
                    <span><strong></strong>标签</span>
                </td>
                <td>
                    <input class="long" name="tags" type="text"  value="{if isset($rowData['tags'])}{$rowData['tags']}{/if}" >
                    <i class="tips1 iconfont icon-yiwen" title="多个请使用,分割"></i>
                </td>
            </tr>
            {/if}
            <tr>
                <td class="tl">
                    <span>文章内容</span>
                </td>
                <td>
                    {include 'admin/layout/file_editor_load'}
                    <textarea name="content" id="content" style="width: 100%; height: 300px;">{if isset($rowData['articleContent'])}{$rowData['articleContent']}{/if}</textarea>
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>内容选项</span>
                </td>
                <td>
                    <!--<input type="checkbox"  name="urlReplace">内链替换&nbsp;-->
                    <input type="checkbox"  name="downloadImages">下载远程图片&nbsp;
                    <input type="checkbox" name="clearLink">清除链接&nbsp;
                    截取内容<input type="number"  name="extractContentToDescription" value="{setting('extractContentToDescLen',getVal($request,'moduleId'))}" >字符至简介&nbsp;
                    设置内容第<input type="number"  name="setNumberImgToThumbnail" value="{setting('setNumberImgToThumbnail',getVal($request,'moduleId'))}"  >张图片为标题图
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>文章状态</span>
                </td>
                <td>
                    <p class="article-status">
                        <input name="status" type="radio" value="1" {if isset($rowData['status']) && $rowData['status']==1 } checked {/if} >草稿
                        <input name="status" type="radio" value="2" {if isset($rowData['status']) && $rowData['status']==2 } checked {/if} >待审核
                        <input name="status" type="radio" value="3" {if isset($rowData['status']) && $rowData['status']==3 } checked {/if} >已发布
                    </p>
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>添加时间</span>
                </td>
                <td>
                    <input autocomplete="off" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datamin" name="addTime"  class="searchInput lb-input-sm Wdate" style="width:180px;" value="{if isset($rowData['addTime']) && $rowData['addTime']}{date('Y-m-d H:i:s',$rowData['addTime'])}{/if}" >
                </td>
            </tr>
        </table>
        <div class="ltcms-button">
            <button class="btns submit ajaxBtn" type="button"  data-submit-url="{LTCMS_ROUTE_PREFIX}/article" data-form=".ajaxForm" data-location-url="{LTCMS_ROUTE_PREFIX}/article?moduleId={$request['moduleId']}" data-close="5" >保存并提交</button>
            <button class="btns cancel" type="button">取消并返回</button>
        </div>
    </form>
</div>
<script src="__ADMIN_STATIC__/js/addContent.js?random={extendSetting('random')}"></script>
{include 'admin/layout/file_upload_script_auto'}
{include 'admin/layout/footer'}